import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

import VueRouter from 'vue-router'

// highlight.js代码高亮指令
// import Highlight from '@/utils/highlight';

// Vue.use(Highlight)


// 返回组件全局挂载
import goback from '@/components/getback/getback.vue'
Vue.component(goback.name, goback)
//弹幕
import { vueBaberrage } from 'vue-baberrage'
Vue.use(vueBaberrage)

// 挂载 用：this.$message就行
Vue.prototype.$message = ElementUI.Message



// 挂载
import api from '@/api/index.js'
Vue.prototype.$api = api


Vue.config.productionTip = false
Vue.use(ElementUI);

// 编辑器
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
Vue.use(mavonEditor)

// 节流插件
import lodash from 'lodash'
Object.defineProperty(Vue.prototype, '$_', { value: lodash })

Vue.prototype.$api = api

Vue.prototype.$bus = new Vue()

// 重新push
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}


// 导入图标
import "./assets/cion/iconfont.css"
//图片放大
import 'viewerjs/dist/viewer.css'
import Viewer from 'v-viewer'
Viewer.setDefaults({
  Options: {
    'inline': true,
    'button': true,
    'navbar': true,
    'title': true,
    'toolbar': true,
    'tooltip': true,
    'movable': true,
    'zoomable': true,
    'rotatable': true,
    'scalable': true,
    'transition': true,
    'fullscreen': true,
    'keyboard': true,
    'url': 'data-source'
  }
})
Vue.use(Viewer)

import 'default-passive-events'

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')